package org.hawk.gwt.ppc.scanner.utils;

import java.util.Collections;
import java.util.List;
/**
 * Wildcard generic type scope.
 * Generally speaking this is not a type at all but rather type range.
 * 
 * @author alex.bereznevatiy@gmail.com
 */
public class JavaWildcardGenericTypeScope extends JavaGenericTypeScope {
	
	private JavaTypeScope lowerBound;
	private List<JavaTypeScope> upperBounds;

	JavaWildcardGenericTypeScope(JavaNameResolver owner, JavaTypeScope lowerBound, JavaTypeScope upperBound) {
		super(upperBound, owner);
		this.lowerBound = lowerBound;
		if (upperBound == null) {
			this.upperBounds = Collections.emptyList();
		} else {
			this.upperBounds = Collections.singletonList(upperBound);
		}
	}
	/**
	 * @return lower bound of the wildcard type.
	 */
	public JavaTypeScope getLowerBound() {
		return lowerBound;
	}
	/**
	 * @return list of upper bounds of the wildcard type
	 */
	public List<JavaTypeScope> getUpperBounds() {
		return upperBounds;
	}

}
